import request from '@/utils/request'

export function rooms(queryParams) {
  return request({
    url: `/v2/basic/room`,
    method: 'GET',
    params: queryParams
  })
}

export const getDormitoryList = () => {
  return request({
    url: '/v2/basic/dormitory',
    method: 'GET'
  })
}

// 删除宿舍
export const delDorm = (data) => {
  return request({
    url: '/v2/basic/dormitory',
    method: 'delete',
    data
  })
}

// 添加房间人员
export const addPersonToRoom = (data) => {
  return request({
    url: '/v2/dormitory/room/user',
    method: 'post',
    data
  })
}

// 获取房间详情
export function room(id) {
  return request({
    url: `/v2/dormitory/room/${id}`,
    method: 'GET'
  })
}

// 删除房间人员
export const removePersonFromRoom = (params) => {
  return request({
    url: '/v2/dormitory/room/user',
    method: 'delete',
    params
  })
}

// 修改房间人员
export const editPersonForRoom = (params) => {
  return request({
    url: '/v2/dormitory/room/user',
    method: 'put',
    params
  })
}

// 获取宿舍详情
export function dormitory(id) {
  return request({
    url: `/v2/dormitory/${id}`,
    method: 'GET'
  })
}

// 获取入住人员
export function getCheckInStaff(params) {
  return request({
    url: '/v2/dormitory/get/users',
    method: 'GET',
    params
  })
}
